home *** CD-ROM | disk | FTP | other *** search
- From: envbvs@epb2.lbl.gov (Brian V. Smith)
- Newsgroups: comp.sources.x
- Subject: v06i054: xfig 2.0 (part 5/7), Patch5
- Message-ID: <133695@sun.Eng.Sun.COM>
- Date: 30 Mar 90 04:34:01 GMT
- Approved: argv@sun.com
-
- Submitted-by: envbvs@epb2.lbl.gov (Brian V. Smith)
- Posting-number: Volume 6, Issue 54
- Archive-name: xfig2/patch5e
- Patch-To: xfig2: Volume 6, Issue 9-24,34-36
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 5 (of 7)."
- # Contents: panel.c.diff
- # Wrapped by envbvs@epb2.lbl.gov on Wed Mar 28 09:05:07 1990
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'panel.c.diff' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'panel.c.diff'\"
- else
- echo shar: Extracting \"'panel.c.diff'\" \(30195 characters\)
- sed "s/^X//" >'panel.c.diff' <<'END_OF_FILE'
- X*** panel.c.p5 Mon Mar 12 12:04:18 1990
- X--- panel.c Mon Mar 26 15:31:22 1990
- X***************
- X*** 30,36 ****
- X extern int fill_mode;
- X extern int foreground_color;
- X extern char current_file[];
- X- extern int landscape;
- X extern int print_landscape;
- X extern int size_button;
- X extern int type_button;
- X--- 30,35 ----
- X***************
- X*** 37,45 ****
- X extern char *printer;
- X extern int cur_printer;
- X extern char *printer_list[];
- X- extern int INCHES;
- X extern TOOL fontmenu; /* popup menu for printer fonts */
- X! extern int figure_modified;
- X
- X /************** local variables and routines **************/
- X
- X--- 36,43 ----
- X extern char *printer;
- X extern int cur_printer;
- X extern char *printer_list[];
- X extern TOOL fontmenu; /* popup menu for printer fonts */
- X! extern appresStruct appres;
- X
- X /************** local variables and routines **************/
- X
- X***************
- X*** 97,102 ****
- X--- 95,102 ----
- X static F_switch *text_just_sw; /* text justification button */
- X static F_switch *land_port_sw; /* landscape/portrait button */
- X
- X+ TOOL ind_box; /* allow main() to access this widget */
- X+
- X #define on_action(z) (z->on_func)(z)
- X #define off_action(z) (z->off_func)(z)
- X
- X***************
- X*** 207,266 ****
- X
- X static Arg panel_args[] =
- X {
- X! /* 0 */ { XtNx, (XtArgVal)0 },
- X! /* 1 */ { XtNy, (XtArgVal)0 },
- X! /* 2 */ { XtNwidth, (XtArgVal)0 },
- X! /* 3 */ { XtNheight, (XtArgVal)0 },
- X! /* 4 */ { XtNhSpace, (XtArgVal)SWITCH_ICON_SPACING },
- X! /* 5 */ { XtNvSpace, (XtArgVal)SWITCH_ICON_SPACING },
- X /* Fix the size of the panel window by chaining both top & bottom
- X to the top of the form, and both left & right to the right.
- X If RHS_PANEL, then chain left/right to RIGHT of form */
- X! /* 6 */ { XtNtop, (XtArgVal)XtChainTop},
- X! /* 7 */ { XtNbottom, (XtArgVal)XtChainTop},
- X! /* 8 */ { XtNleft, (XtArgVal)XtChainLeft },
- X! /* 9 */ { XtNright, (XtArgVal)XtChainLeft },
- X! /* 10 */ { XtNresizable, (XtArgVal) False },
- X };
- X
- X static Arg panel2_args[] =
- X {
- X! /* 0 */ { XtNx, (XtArgVal)0 },
- X! /* 1 */ { XtNy, (XtArgVal)0 },
- X! /* 2 */ { XtNwidth, (XtArgVal)0 },
- X! /* 3 */ { XtNheight, (XtArgVal)0 },
- X! /* 4 */ { XtNhSpace, (XtArgVal)SWITCH_ICON_SPACING },
- X! /* 5 */ { XtNvSpace, (XtArgVal) SWITCH_ICON_SPACING/2 },
- X! /* 6 */ { XtNresizable, (XtArgVal) FALSE },
- X! /* 7 */ { XtNfromHoriz, (XtArgVal) NULL },
- X! /* 8 */ { XtNfromVert, (XtArgVal) NULL },
- X! /* 9 */ { XtNhorizDistance, (XtArgVal) SWITCH_ICON_SPACING },
- X! /* 10 */ { XtNvertDistance, (XtArgVal) 1 },
- X /* Fix the size of the panel window by chaining both top & bottom
- X to the top of the form, and both left & right to the right */
- X! /* 11 */ { XtNtop, (XtArgVal)XtChainBottom},
- X! /* 12 */ { XtNbottom, (XtArgVal)XtChainBottom},
- X! /* 13 */ { XtNleft, (XtArgVal)XtChainLeft },
- X! /* 14 */ { XtNright, (XtArgVal)XtChainLeft },
- X };
- X
- X static Arg ind_box_args[] =
- X {
- X! /* 0 */ { XtNx, (XtArgVal)0 },
- X! /* 1 */ { XtNy, (XtArgVal)0 },
- X! /* 2 */ { XtNwidth, (XtArgVal)0 },
- X! /* 3 */ { XtNheight, (XtArgVal)0 },
- X! /* 4 */ { XtNhSpace, (XtArgVal)SWITCH_ICON_SPACING },
- X! /* 5 */ { XtNvSpace, (XtArgVal)SWITCH_ICON_SPACING },
- X! /* 6 */ { XtNfromVert, (XtArgVal) NULL },
- X! /* 7 */ { XtNvertDistance, (XtArgVal) SWITCH_ICON_SPACING },
- X /* Fix the size of the panel window by chaining both top & bottom
- X to the top of the form, and both left & right to the right
- X If RHS_PANEL, then chain left/right to RIGHT of form */
- X! /* 8 */ { XtNtop, (XtArgVal)XtChainTop},
- X! /* 9 */ { XtNbottom, (XtArgVal)XtChainTop},
- X! /* 10 */ { XtNleft, (XtArgVal)XtChainLeft },
- X! /* 11 */ { XtNright, (XtArgVal)XtChainLeft },
- X };
- X
- X /* widget arguments to show the current fill color and line thickness*/
- X--- 207,258 ----
- X
- X static Arg panel_args[] =
- X {
- X! /* 0 */ { XtNwidth, (XtArgVal) 0 },
- X! /* 1 */ { XtNhSpace, (XtArgVal)SWITCH_ICON_SPACING },
- X! /* 2 */ { XtNvSpace, (XtArgVal)SWITCH_ICON_SPACING },
- X /* Fix the size of the panel window by chaining both top & bottom
- X to the top of the form, and both left & right to the right.
- X If RHS_PANEL, then chain left/right to RIGHT of form */
- X! /* 3 */ { XtNtop, (XtArgVal)XtChainTop },
- X! /* 4 */ { XtNbottom, (XtArgVal)XtChainTop },
- X! /* 5 */ { XtNleft, (XtArgVal)XtChainLeft },
- X! /* 6 */ { XtNright, (XtArgVal)XtChainLeft },
- X! /* 7 */ { XtNresizable, (XtArgVal) False },
- X! /* 8 */ { XtNborderWidth, (XtArgVal) 2 },
- X! /* 9 */ { XtNvertDistance, (XtArgVal) 0 }, /* touching top of form */
- X };
- X
- X static Arg panel2_args[] =
- X {
- X! /* 0 */ { XtNwidth, (XtArgVal)0 },
- X! /* 1 */ { XtNhSpace, (XtArgVal) 1 },
- X! /* 2 */ { XtNvSpace, (XtArgVal) 1 },
- X! /* 3 */ { XtNresizable, (XtArgVal) False },
- X! /* 4 */ { XtNfromVert, (XtArgVal) NULL }, /* will be from psfont */
- X! /* 5 */ { XtNvertDistance, (XtArgVal) -1 },
- X! /* 6 */ { XtNhorizDistance, (XtArgVal) 1 },
- X /* Fix the size of the panel window by chaining both top & bottom
- X to the top of the form, and both left & right to the right */
- X! /* 7 */ { XtNtop, (XtArgVal)XtChainBottom },
- X! /* 8 */ { XtNbottom, (XtArgVal)XtChainBottom },
- X! /* 9 */ { XtNleft, (XtArgVal)XtChainLeft },
- X! /* 10 */ { XtNright, (XtArgVal)XtChainLeft },
- X };
- X
- X static Arg ind_box_args[] =
- X {
- X! /* 0 */ { XtNwidth, (XtArgVal) 0 },
- X! /* 1 */ { XtNhSpace, (XtArgVal)SWITCH_ICON_SPACING },
- X! /* 2 */ { XtNfromVert, (XtArgVal) NULL }, /* will be from panel_sw */
- X! /* 3 */ { XtNvertDistance, (XtArgVal) 0 },
- X! /* 4 */ { XtNborderWidth, (XtArgVal) 2 },
- X /* Fix the size of the panel window by chaining both top & bottom
- X to the top of the form, and both left & right to the right
- X If RHS_PANEL, then chain left/right to RIGHT of form */
- X! /* 5 */ { XtNtop, (XtArgVal)XtChainTop },
- X! /* 6 */ { XtNbottom, (XtArgVal)XtChainTop },
- X! /* 7 */ { XtNleft, (XtArgVal)XtChainLeft },
- X! /* 8 */ { XtNright, (XtArgVal)XtChainLeft },
- X };
- X
- X /* widget arguments to show the current fill color and line thickness*/
- X***************
- X*** 267,307 ****
- X
- X static Arg indicator_panel_args[] =
- X {
- X! /* 0 */ { XtNx, (XtArgVal)0 },
- X! /* 1 */ { XtNy, (XtArgVal)0 },
- X! /* 2 */ { XtNlabel, (XtArgVal)" " },
- X! /* 3 */ { XtNwidth, (XtArgVal) SWITCH_ICON_WIDTH },
- X! /* 4 */ { XtNheight, (XtArgVal) SWITCH_ICON_HEIGHT },
- X! /* 5 */ { XtNresizable, (XtArgVal) FALSE },
- X! /* 6 */ { XtNborderWidth, (XtArgVal) 1},
- X! /* 7 */ { XtNbackgroundPixmap, (XtArgVal) NULL },
- X };
- X
- X static void button_select();
- X
- X- /* we aren't using the callback anymore - see sel_but() */
- X- static XtCallbackRec button_callbacks[] =
- X- {
- X- { button_select, NULL },
- X- { NULL, NULL },
- X- };
- X-
- X static Arg button_args[] =
- X {
- X! /* 0 */ { XtNx, (XtArgVal)0 },
- X! /* 1 */ { XtNy, (XtArgVal)0 },
- X! /* 2 */ { XtNlabel, (XtArgVal)" " },
- X! /* 3 */ { XtNwidth, (XtArgVal)0 },
- X! /* 4 */ { XtNheight, (XtArgVal)0 },
- X! /* 5 */ { XtNbackgroundPixmap, (XtArgVal)NULL },
- X! /* 6 */ { XtNresizable, (XtArgVal) FALSE },
- X! /* 7 */ { XtNborderWidth, (XtArgVal) 1},
- X! /* 8 */ { XtNresize, (XtArgVal) FALSE }, /* this keeps the damned buttons from
- X being resized when there are not a
- X multiple of three of them */
- X-
- X- /* callbacks not used anymore */
- X- /* 8 */ /* { XtNcallback, (XtArgVal)button_callbacks }, */
- X };
- X
- X extern int PANEL_LEFT, PANEL_TOP, PANEL_HEIGHT, PANEL_WID;
- X--- 259,285 ----
- X
- X static Arg indicator_panel_args[] =
- X {
- X! /* 0 */ { XtNlabel, (XtArgVal)" " },
- X! /* 1 */ { XtNwidth, (XtArgVal) SWITCH_ICON_WIDTH },
- X! /* 2 */ { XtNheight, (XtArgVal) SWITCH_ICON_HEIGHT },
- X! /* 3 */ { XtNresizable, (XtArgVal) False },
- X! /* 4 */ { XtNborderWidth, (XtArgVal) 1 },
- X! /* 5 */ { XtNbackgroundPixmap, (XtArgVal) NULL },
- X };
- X
- X static void button_select();
- X
- X static Arg button_args[] =
- X {
- X! /* 0 */ { XtNlabel, (XtArgVal)" " },
- X! /* 1 */ { XtNwidth, (XtArgVal) 0 },
- X! /* 2 */ { XtNheight, (XtArgVal) 0 },
- X! /* 3 */ { XtNbackgroundPixmap, (XtArgVal)NULL },
- X! /* 4 */ { XtNresizable, (XtArgVal) False },
- X! /* 5 */ { XtNborderWidth, (XtArgVal) 1 },
- X! /* 6 */ { XtNresize, (XtArgVal) False }, /* this keeps the damned buttons from
- X being resized when there are not a
- X multiple of three of them */
- X };
- X
- X extern int PANEL_LEFT, PANEL_TOP, PANEL_HEIGHT, PANEL_WID;
- X***************
- X*** 321,341 ****
- X register F_switch *sw;
- X
- X /* width */
- X! panel_args[2].value = PANEL_WID =
- X (SWITCH_ICON_WIDTH + 2 + SWITCH_ICON_SPACING) * ICON_COLUMN
- X + SWITCH_ICON_SPACING;
- X! /* height */
- X! panel_args[3].value = PANEL_HEIGHT = CANVAS_HEIGHT + RULER_WIDTH + MSG_HEIGHT;
- X! panel_sw = XtCreateWidget("panel", boxWidgetClass, tool, panel_args,
- X! XtNumber(panel_args));
- X
- X for (i = 0; i < N_SWITCHES; ++i)
- X {
- X sw = &switches[i];
- X! button_args[0].value = sw->x * sw->icon->width;
- X! button_args[1].value = sw->y * sw->icon->height;
- X! button_args[3].value = sw->icon->width;
- X! button_args[4].value = sw->icon->height;
- X sw->but.widget = XtCreateManagedWidget(
- X "button", commandWidgetClass,
- X panel_sw, button_args, XtNumber(button_args));
- X--- 299,315 ----
- X register F_switch *sw;
- X
- X /* width */
- X! panel_args[0].value = PANEL_WID =
- X (SWITCH_ICON_WIDTH + 2 + SWITCH_ICON_SPACING) * ICON_COLUMN
- X + SWITCH_ICON_SPACING;
- X! panel_sw = XtCreateWidget("side_panel", boxWidgetClass, tool,
- X! panel_args, XtNumber(panel_args));
- X
- X for (i = 0; i < N_SWITCHES; ++i)
- X {
- X sw = &switches[i];
- X! button_args[1].value = sw->icon->width; /* button width */
- X! button_args[2].value = sw->icon->height; /* button height */
- X sw->but.widget = XtCreateManagedWidget(
- X "button", commandWidgetClass,
- X panel_sw, button_args, XtNumber(button_args));
- X***************
- X*** 355,365 ****
- X register F_switch *sw;
- X
- X
- X! panel2_args[2].value = PANEL2_WID = 2 * N_SWITCHES2 *
- X (SWITCH_ICON_WIDTH + SWITCH_ICON_SPACING)
- X + SWITCH_ICON_SPACING;
- X! panel2_args[3].value=PANEL2_HEIGHT= SWITCH_ICON_HEIGHT + 3*SWITCH_ICON_SPACING;
- X! panel2_args[8].value = (XtArgVal) psfont; /* vert offset from font window */
- X
- X panel2_sw = XtCreateWidget("bottom_panel", boxWidgetClass, tool, panel2_args,
- X XtNumber(panel2_args));
- X--- 329,339 ----
- X register F_switch *sw;
- X
- X
- X! /* panel width */
- X! panel2_args[0].value = PANEL2_WID = 2 * N_SWITCHES2 *
- X (SWITCH_ICON_WIDTH + SWITCH_ICON_SPACING)
- X + SWITCH_ICON_SPACING;
- X! panel2_args[4].value = (XtArgVal) psfont; /* vert offset from font window */
- X
- X panel2_sw = XtCreateWidget("bottom_panel", boxWidgetClass, tool, panel2_args,
- X XtNumber(panel2_args));
- X***************
- X*** 366,375 ****
- X for (i = 0; i < N_SWITCHES2; ++i)
- X {
- X sw = &switches2[i];
- X! button_args[0].value = sw->x * sw->icon->width;
- X! button_args[1].value = sw->y * sw->icon->height;
- X! button_args[3].value = sw->icon->width;
- X! button_args[4].value = sw->icon->height;
- X sw->but.widget = XtCreateManagedWidget(
- X "button", commandWidgetClass,
- X panel2_sw, button_args, XtNumber(button_args));
- X--- 340,347 ----
- X for (i = 0; i < N_SWITCHES2; ++i)
- X {
- X sw = &switches2[i];
- X! button_args[1].value = sw->icon->width; /* button width */
- X! button_args[2].value = sw->icon->height; /* button height */
- X sw->but.widget = XtCreateManagedWidget(
- X "button", commandWidgetClass,
- X panel2_sw, button_args, XtNumber(button_args));
- X***************
- X*** 380,416 ****
- X return (1);
- X }
- X
- X! Widget ind_box;
- X
- X init_indicator_panel(tool)
- X TOOL tool;
- X {
- X /* width */
- X! ind_box_args[2].value =
- X! (SWITCH_ICON_WIDTH + 2 + SWITCH_ICON_SPACING)*3 + SWITCH_ICON_SPACING;
- X! /* height */
- X! ind_box_args[3].value = SWITCH_ICON_HEIGHT+2*SWITCH_ICON_SPACING;
- X
- X /* put below bottom of panel_sw */
- X! ind_box_args[6].value = (XtArgVal) panel_sw;
- X
- X ind_box = XtCreateWidget("indicator", boxWidgetClass, tool, ind_box_args,
- X XtNumber(ind_box_args));
- X
- X! indicator_panel_args[7].value = (XtArgVal) ind_fill_pm[0];/* white pixmap */
- X
- X! /* horiz position for line thickness indicator */
- X! indicator_panel_args[0].value = (XtArgVal) SWITCH_ICON_SPACING;
- X line_thick_panel = XtCreateManagedWidget( "linewidth_indicator", boxWidgetClass,
- X ind_box, indicator_panel_args, XtNumber(indicator_panel_args));
- X
- X! /* horiz position for rounded-corner box radius indicator */
- X! indicator_panel_args[0].value += SWITCH_ICON_WIDTH+SWITCH_ICON_SPACING;
- X radius_panel = XtCreateManagedWidget( "radius_indicator", boxWidgetClass,
- X ind_box, indicator_panel_args, XtNumber(indicator_panel_args));
- X
- X! /* horiz position for fill_area color */
- X! indicator_panel_args[0].value += SWITCH_ICON_WIDTH+SWITCH_ICON_SPACING;
- X fill_panel = XtCreateManagedWidget( "fill_indicator", boxWidgetClass,
- X ind_box, indicator_panel_args, XtNumber(indicator_panel_args));
- X }
- X--- 352,384 ----
- X return (1);
- X }
- X
- X! #define NUM_IND 3 /* number of indicator widgets */
- X
- X init_indicator_panel(tool)
- X TOOL tool;
- X {
- X /* width */
- X! ind_box_args[0].value =
- X! (SWITCH_ICON_WIDTH + 2 + SWITCH_ICON_SPACING)*NUM_IND
- X! + SWITCH_ICON_SPACING;
- X
- X /* put below bottom of panel_sw */
- X! ind_box_args[2].value = (XtArgVal) panel_sw;
- X
- X ind_box = XtCreateWidget("indicator", boxWidgetClass, tool, ind_box_args,
- X XtNumber(ind_box_args));
- X
- X! indicator_panel_args[5].value = (XtArgVal) ind_fill_pm[0];/* white pixmap */
- X
- X! /* rounded-corner box radius indicator */
- X line_thick_panel = XtCreateManagedWidget( "linewidth_indicator", boxWidgetClass,
- X ind_box, indicator_panel_args, XtNumber(indicator_panel_args));
- X
- X! /* line thickness indicator */
- X radius_panel = XtCreateManagedWidget( "radius_indicator", boxWidgetClass,
- X ind_box, indicator_panel_args, XtNumber(indicator_panel_args));
- X
- X! /* fill_area color */
- X fill_panel = XtCreateManagedWidget( "fill_indicator", boxWidgetClass,
- X ind_box, indicator_panel_args, XtNumber(indicator_panel_args));
- X }
- X***************
- X*** 426,436 ****
- X register Display *d = tool_d;
- X register Screen *s = tool_s;
- X register Pixmap p;
- X- XGCValues gcv;
- X Arg tmp_arg[3];
- X long bg, fg;
- X
- X! button_gc = XCreateGC(d, XtWindow(panel_sw), 0, &gcv);
- X XtSetArg(tmp_arg[0], XtNbackground, &bg);
- X XtSetArg(tmp_arg[1], XtNforeground, &fg);
- X XtGetValues(switches[0].but.widget, tmp_arg, 2);
- X--- 394,403 ----
- X register Display *d = tool_d;
- X register Screen *s = tool_s;
- X register Pixmap p;
- X Arg tmp_arg[3];
- X long bg, fg;
- X
- X! button_gc = XCreateGC(d, XtWindow(panel_sw), (unsigned long)0, NULL);
- X XtSetArg(tmp_arg[0], XtNbackground, &bg);
- X XtSetArg(tmp_arg[1], XtNforeground, &fg);
- X XtGetValues(switches[0].but.widget, tmp_arg, 2);
- X***************
- X*** 446,459 ****
- X sw->icon->width, sw->icon->height,fg,bg,
- X DefaultDepthOfScreen(s));
- X
- X! sw->but.normal = button_args[5].value = (XtArgVal)p;
- X! XtSetValues(sw->but.widget, &button_args[5], 1);
- X }
- X /*
- X ** Create reversed bitmaps for displaying activated state
- X */
- X- XSetForeground(d, button_gc, bg);
- X- XSetBackground(d, button_gc, fg);
- X for (i = 0; i < N_SWITCHES; ++i)
- X {
- X sw = &switches[i];
- X--- 413,424 ----
- X sw->icon->width, sw->icon->height,fg,bg,
- X DefaultDepthOfScreen(s));
- X
- X! sw->but.normal = button_args[3].value = (XtArgVal)p;
- X! XtSetValues(sw->but.widget, &button_args[3], 1);
- X }
- X /*
- X ** Create reversed bitmaps for displaying activated state
- X */
- X for (i = 0; i < N_SWITCHES; ++i)
- X {
- X sw = &switches[i];
- X***************
- X*** 469,476 ****
- X /* now do the same for panel 2 */
- X /*******************************/
- X
- X- XSetForeground(d, button_gc, fg);
- X- XSetBackground(d, button_gc, bg);
- X for (i = 0; i < N_SWITCHES2; ++i)
- X {
- X sw = &switches2[i];
- X--- 434,439 ----
- X***************
- X*** 485,491 ****
- X port_ic.data,
- X port_ic.width, port_ic.height,fg,bg,
- X DefaultDepthOfScreen(s));
- X! if (landscape==0) /* use portrait for startup image */
- X p = lP_pm;
- X land_port_sw = sw; /* save pointer to this switch */
- X }
- X--- 448,454 ----
- X port_ic.data,
- X port_ic.width, port_ic.height,fg,bg,
- X DefaultDepthOfScreen(s));
- X! if (!appres.landscape) /* use portrait for startup image */
- X p = lP_pm;
- X land_port_sw = sw; /* save pointer to this switch */
- X }
- X***************
- X*** 516,529 ****
- X print_sel_widget=sw->but.widget;
- X }
- X
- X! sw->but.normal = button_args[5].value = (XtArgVal)p;
- X! XtSetValues(sw->but.widget, &button_args[5], 1);
- X }
- X /*
- X ** Create reversed bitmaps for displaying activated state
- X */
- X- XSetForeground(d, button_gc, bg);
- X- XSetBackground(d, button_gc, fg);
- X for (i = 0; i < N_SWITCHES2; ++i)
- X {
- X sw = &switches2[i];
- X--- 479,490 ----
- X print_sel_widget=sw->but.widget;
- X }
- X
- X! sw->but.normal = button_args[3].value = (XtArgVal)p;
- X! XtSetValues(sw->but.widget, &button_args[3], 1);
- X }
- X /*
- X ** Create reversed bitmaps for displaying activated state
- X */
- X for (i = 0; i < N_SWITCHES2; ++i)
- X {
- X sw = &switches2[i];
- X***************
- X*** 534,543 ****
- X sw->but.reverse = (XtArgVal)p;
- X }
- X
- X- /* set the foreground and background back to normal */
- X- XSetForeground(d, button_gc, fg);
- X- XSetBackground(d, button_gc, bg);
- X-
- X init_switch();
- X panel_pixwin = panel_swfd = XtWindow(panel_sw);
- X XDefineCursor(d, panel_swfd, (Cursor)arrow_cursor.bitmap);
- X--- 495,500 ----
- X***************
- X*** 600,606 ****
- X extern int latexline_mode;
- X extern int latexarrow_mode;
- X extern int magnet_mode;
- X! extern int cur_line_style;
- X extern float cur_styleval;
- X extern float cur_dashlength;
- X extern float cur_dotgap;
- X--- 557,563 ----
- X extern int latexline_mode;
- X extern int latexarrow_mode;
- X extern int magnet_mode;
- X! extern int line_style;
- X extern float cur_styleval;
- X extern float cur_dashlength;
- X extern float cur_dotgap;
- X***************
- X*** 659,673 ****
- X autobackwardarrow_mode = 1;
- X break;
- X case F_SET_SOLID_LINE :
- X! cur_line_style = SOLID_LINE;
- X cur_styleval = 0.0;
- X break;
- X case F_SET_DASH_LINE :
- X! cur_line_style = DASH_LINE;
- X cur_styleval = cur_dashlength;
- X break;
- X case F_SET_DOTTED_LINE :
- X! cur_line_style = DOTTED_LINE;
- X cur_styleval = cur_dotgap;
- X break;
- X case F_MAGNET :
- X--- 616,630 ----
- X autobackwardarrow_mode = 1;
- X break;
- X case F_SET_SOLID_LINE :
- X! line_style = SOLID_LINE;
- X cur_styleval = 0.0;
- X break;
- X case F_SET_DASH_LINE :
- X! line_style = DASH_LINE;
- X cur_styleval = cur_dashlength;
- X break;
- X case F_SET_DOTTED_LINE :
- X! line_style = DOTTED_LINE;
- X cur_styleval = cur_dotgap;
- X break;
- X case F_MAGNET :
- X***************
- X*** 975,981 ****
- X case F_MAGNET :
- X magnet_mode = 1;
- X put_msg("MAGNET: round entered points to the nearest %s increment",
- X! (INCHES? "1/16\"": "2 mm"));
- X break;
- X case F_FILL :
- X fill_mode = 1;
- X--- 932,938 ----
- X case F_MAGNET :
- X magnet_mode = 1;
- X put_msg("MAGNET: round entered points to the nearest %s increment",
- X! (appres.INCHES? "1/16\"": "2 mm"));
- X break;
- X case F_FILL :
- X fill_mode = 1;
- X***************
- X*** 1014,1020 ****
- X set_style(sw)
- X F_switch *sw;
- X {
- X! extern int cur_line_style;
- X extern float cur_styleval;
- X extern float cur_dashlength;
- X extern float cur_dotgap;
- X--- 971,977 ----
- X set_style(sw)
- X F_switch *sw;
- X {
- X! extern int line_style;
- X extern float cur_styleval;
- X extern float cur_dashlength;
- X extern float cur_dotgap;
- X***************
- X*** 1021,1037 ****
- X
- X switch (sw->value) {
- X case F_SET_SOLID_LINE :
- X! cur_line_style = SOLID_LINE;
- X cur_styleval = 0.0;
- X put_msg("SOLID LINE STYLE (for BOX, POLYGON and POLYLINE)");
- X break;
- X case F_SET_DASH_LINE :
- X! cur_line_style = DASH_LINE;
- X cur_styleval = cur_dashlength;
- X put_msg("DASH LINE STYLE (for BOX, POLYGON and POLYLINE)");
- X break;
- X case F_SET_DOTTED_LINE :
- X! cur_line_style = DOTTED_LINE;
- X cur_styleval = cur_dotgap;
- X put_msg("DOTTED LINE STYLE (for BOX, POLYGON and POLYLINE)");
- X break;
- X--- 978,994 ----
- X
- X switch (sw->value) {
- X case F_SET_SOLID_LINE :
- X! line_style = SOLID_LINE;
- X cur_styleval = 0.0;
- X put_msg("SOLID LINE STYLE (for BOX, POLYGON and POLYLINE)");
- X break;
- X case F_SET_DASH_LINE :
- X! line_style = DASH_LINE;
- X cur_styleval = cur_dashlength;
- X put_msg("DASH LINE STYLE (for BOX, POLYGON and POLYLINE)");
- X break;
- X case F_SET_DOTTED_LINE :
- X! line_style = DOTTED_LINE;
- X cur_styleval = cur_dotgap;
- X put_msg("DOTTED LINE STYLE (for BOX, POLYGON and POLYLINE)");
- X break;
- X***************
- X*** 1043,1049 ****
- X dec_thick(sw)
- X F_switch *sw;
- X {
- X! if (line_thickness > 1)
- X --line_thickness;
- X show_line_thickness();
- X }
- X--- 1000,1006 ----
- X dec_thick(sw)
- X F_switch *sw;
- X {
- X! if (line_thickness > 0)
- X --line_thickness;
- X show_line_thickness();
- X }
- X***************
- X*** 1069,1089 ****
- X DefaultDepthOfScreen(tool_s));
- X /* erase by drawing wide, inverted (white) line */
- X pw_vector(line_pm, 0, SWITCH_ICON_HEIGHT/2,
- X! SWITCH_ICON_WIDTH, SWITCH_ICON_HEIGHT/2, ERASE, SWITCH_ICON_HEIGHT);
- X /* draw current line thickness into pixmap */
- X! pw_vector(line_pm, 0, SWITCH_ICON_HEIGHT/2,
- X! SWITCH_ICON_WIDTH, SWITCH_ICON_HEIGHT/2, PAINT, line_thickness);
- X
- X /* Fool the toolkit by changing the background pixmap to 0
- X then giving it the modified one again. Otherwise, it sees
- X that the pixmap ID is not changed and doesn't actually draw
- X it into the widget window */
- X! indicator_panel_args[7].value = 0;
- X! XtSetValues(line_thick_panel, &indicator_panel_args[7], 1);
- X
- X /* put the pixmap in the widget background */
- X! indicator_panel_args[7].value = line_pm;
- X! XtSetValues(line_thick_panel, &indicator_panel_args[7], 1);
- X put_msg("LINE Thickness = %d",line_thickness);
- X }
- X
- X--- 1026,1049 ----
- X DefaultDepthOfScreen(tool_s));
- X /* erase by drawing wide, inverted (white) line */
- X pw_vector(line_pm, 0, SWITCH_ICON_HEIGHT/2,
- X! SWITCH_ICON_WIDTH, SWITCH_ICON_HEIGHT/2, ERASE,
- X! SWITCH_ICON_HEIGHT, SOLID_LINE, 0.0);
- X /* draw current line thickness into pixmap */
- X! if (line_thickness > 0) /* don't draw line for zero-thickness */
- X! pw_vector(line_pm, 0, SWITCH_ICON_HEIGHT/2,
- X! SWITCH_ICON_WIDTH, SWITCH_ICON_HEIGHT/2, PAINT,
- X! line_thickness, SOLID_LINE, 0.0);
- X
- X /* Fool the toolkit by changing the background pixmap to 0
- X then giving it the modified one again. Otherwise, it sees
- X that the pixmap ID is not changed and doesn't actually draw
- X it into the widget window */
- X! indicator_panel_args[5].value = 0;
- X! XtSetValues(line_thick_panel, &indicator_panel_args[5], 1);
- X
- X /* put the pixmap in the widget background */
- X! indicator_panel_args[5].value = line_pm;
- X! XtSetValues(line_thick_panel, &indicator_panel_args[5], 1);
- X put_msg("LINE Thickness = %d",line_thickness);
- X }
- X
- X***************
- X*** 1120,1140 ****
- X DefaultDepthOfScreen(tool_s));
- X /* erase by drawing wide, inverted (white) line */
- X pw_vector(radius_pm, 0, SWITCH_ICON_HEIGHT/2,
- X! SWITCH_ICON_WIDTH, SWITCH_ICON_HEIGHT/2, ERASE, SWITCH_ICON_HEIGHT);
- X /* draw current radius into pixmap */
- X curve(radius_pm, 0, cur_radius, cur_radius, 0, 0, 1, 1,
- X! 1, SWITCH_ICON_HEIGHT-2, foreground_color, 1, 0);
- X
- X /* Fool the toolkit by changing the background pixmap to 0
- X then giving it the modified one again. Otherwise, it sees
- X that the pixmap ID is not changed and doesn't actually draw
- X it into the widget window */
- X! indicator_panel_args[7].value = 0;
- X! XtSetValues(radius_panel, &indicator_panel_args[7], 1);
- X
- X /* put the pixmap in the widget background */
- X! indicator_panel_args[7].value = radius_pm;
- X! XtSetValues(radius_panel, &indicator_panel_args[7], 1);
- X put_msg("ROUNDED-CORNER BOX Radius = %d",cur_radius);
- X }
- X
- X--- 1080,1102 ----
- X DefaultDepthOfScreen(tool_s));
- X /* erase by drawing wide, inverted (white) line */
- X pw_vector(radius_pm, 0, SWITCH_ICON_HEIGHT/2,
- X! SWITCH_ICON_WIDTH, SWITCH_ICON_HEIGHT/2, ERASE,
- X! SWITCH_ICON_HEIGHT, SOLID_LINE, 0.0);
- X /* draw current radius into pixmap */
- X curve(radius_pm, 0, cur_radius, cur_radius, 0, 0, 1, 1,
- X! 1, SWITCH_ICON_HEIGHT-2, foreground_color,
- X! 1, SOLID_LINE, 0, 0.0);
- X
- X /* Fool the toolkit by changing the background pixmap to 0
- X then giving it the modified one again. Otherwise, it sees
- X that the pixmap ID is not changed and doesn't actually draw
- X it into the widget window */
- X! indicator_panel_args[5].value = 0;
- X! XtSetValues(radius_panel, &indicator_panel_args[5], 1);
- X
- X /* put the pixmap in the widget background */
- X! indicator_panel_args[5].value = radius_pm;
- X! XtSetValues(radius_panel, &indicator_panel_args[5], 1);
- X put_msg("ROUNDED-CORNER BOX Radius = %d",cur_radius);
- X }
- X
- X***************
- X*** 1157,1164 ****
- X show_fill_color()
- X {
- X /* put fill pixmap in widget background */
- X! indicator_panel_args[7].value = ind_fill_pm[cur_areafill-1];
- X! XtSetValues(fill_panel, &indicator_panel_args[7], 1);
- X put_fmsg("FILL GRAY = %.2f", 1.0-(cur_areafill-1.0)/(NUMFILLPATS-1.0));
- X }
- X
- X--- 1119,1126 ----
- X show_fill_color()
- X {
- X /* put fill pixmap in widget background */
- X! indicator_panel_args[5].value = ind_fill_pm[cur_areafill-1];
- X! XtSetValues(fill_panel, &indicator_panel_args[5], 1);
- X put_fmsg("FILL GRAY = %.2f", 1.0-(cur_areafill-1.0)/(NUMFILLPATS-1.0));
- X }
- X
- X***************
- X*** 1268,1288 ****
- X
- X /* first erase any existing string in pixmap */
- X XDrawImageString(tool_d, print_sel_pm, button_gc,
- X! 6, 28, " ", 8);
- X /* write the printer name in the background pixmap */
- X XDrawImageString(tool_d, print_sel_pm, button_gc,
- X! 6, 28, printer, strlen(printer));
- X
- X /* Fool the toolkit by changing the background pixmap to 0
- X then giving it the modified one again. Otherwise, it sees
- X that the pixmap ID is not changed and doesn't actually draw
- X it into the widget window */
- X! button_args[5].value = 0;
- X! XtSetValues(print_sel_widget, &button_args[5], 1);
- X
- X /* put the pixmap in the widget background */
- X! button_args[5].value = print_sel_pm;
- X! XtSetValues(print_sel_widget, &button_args[5], 1);
- X }
- X
- X /* popup menu of printer fonts */
- X--- 1230,1250 ----
- X
- X /* first erase any existing string in pixmap */
- X XDrawImageString(tool_d, print_sel_pm, button_gc,
- X! 6, 24, " ", 8);
- X /* write the printer name in the background pixmap */
- X XDrawImageString(tool_d, print_sel_pm, button_gc,
- X! 6, 24, printer, strlen(printer));
- X
- X /* Fool the toolkit by changing the background pixmap to 0
- X then giving it the modified one again. Otherwise, it sees
- X that the pixmap ID is not changed and doesn't actually draw
- X it into the widget window */
- X! button_args[3].value = 0;
- X! XtSetValues(print_sel_widget, &button_args[3], 1);
- X
- X /* put the pixmap in the widget background */
- X! button_args[3].value = print_sel_pm;
- X! XtSetValues(print_sel_widget, &button_args[3], 1);
- X }
- X
- X /* popup menu of printer fonts */
- X***************
- X*** 1305,1312 ****
- X type_button = 0;
- X /* put the pixmap in the widget background */
- X text_just_sw->but.normal = text_just_sw->but.reverse =
- X! button_args[5].value = (XtArgVal) text_just_pm[type_button];
- X! XtSetValues(text_just_sw->but.widget, &button_args[5], 1);
- X if (type_button==T_LEFT_JUSTIFIED)
- X put_msg("Left justify text");
- X else if (type_button==T_CENTER_JUSTIFIED)
- X--- 1267,1274 ----
- X type_button = 0;
- X /* put the pixmap in the widget background */
- X text_just_sw->but.normal = text_just_sw->but.reverse =
- X! button_args[3].value = (XtArgVal) text_just_pm[type_button];
- X! XtSetValues(text_just_sw->but.widget, &button_args[3], 1);
- X if (type_button==T_LEFT_JUSTIFIED)
- X put_msg("Left justify text");
- X else if (type_button==T_CENTER_JUSTIFIED)
- X***************
- X*** 1383,1394 ****
- X then giving it the modified one again. Otherwise, it sees
- X that the pixmap ID is not changed and doesn't actually draw
- X it into the widget window */
- X! button_args[5].value = 0;
- X! XtSetValues(font_size_widget, &button_args[5], 1);
- X
- X /* put the pixmap in the widget background */
- X! button_args[5].value = font_size_pm;
- X! XtSetValues(font_size_widget, &button_args[5], 1);
- X }
- X
- X /* change landscape/portrait flag for print */
- X--- 1345,1356 ----
- X then giving it the modified one again. Otherwise, it sees
- X that the pixmap ID is not changed and doesn't actually draw
- X it into the widget window */
- X! button_args[3].value = 0;
- X! XtSetValues(font_size_widget, &button_args[3], 1);
- X
- X /* put the pixmap in the widget background */
- X! button_args[3].value = font_size_pm;
- X! XtSetValues(font_size_widget, &button_args[3], 1);
- X }
- X
- X /* change landscape/portrait flag for print */
- X***************
- X*** 1406,1413 ****
- X land_port()
- X {
- X land_port_sw->but.normal = land_port_sw->but.reverse =
- X! button_args[5].value = (XtArgVal) (print_landscape? Lp_pm: lP_pm);
- X! XtSetValues(land_port_sw->but.widget, &button_args[5], 1);
- X put_msg("Print in %s mode",print_landscape? "LANDSCAPE": "PORTRAIT");
- X }
- X
- X--- 1368,1375 ----
- X land_port()
- X {
- X land_port_sw->but.normal = land_port_sw->but.reverse =
- X! button_args[3].value = (XtArgVal) (print_landscape? Lp_pm: lP_pm);
- X! XtSetValues(land_port_sw->but.widget, &button_args[3], 1);
- X put_msg("Print in %s mode",print_landscape? "LANDSCAPE": "PORTRAIT");
- X }
- X
- X***************
- X*** 1433,1440 ****
- X F_switch *s;
- X {
- X s->on = 1;
- X! button_args[5].value = (XtArgVal)s->but.reverse;
- X! XtSetValues(s->but.widget, &button_args[5], 1);
- X }
- X
- X turn_off(s)
- X--- 1395,1402 ----
- X F_switch *s;
- X {
- X s->on = 1;
- X! button_args[3].value = (XtArgVal)s->but.reverse;
- X! XtSetValues(s->but.widget, &button_args[3], 1);
- X }
- X
- X turn_off(s)
- X***************
- X*** 1441,1448 ****
- X F_switch *s;
- X {
- X s->on = 0;
- X! button_args[5].value = (XtArgVal)s->but.normal;
- X! XtSetValues(s->but.widget, &button_args[5], 1);
- X }
- X
- X static
- X--- 1403,1410 ----
- X F_switch *s;
- X {
- X s->on = 0;
- X! button_args[3].value = (XtArgVal)s->but.normal;
- X! XtSetValues(s->but.widget, &button_args[3], 1);
- X }
- X
- X static
- END_OF_FILE
- if test 30195 -ne `wc -c <'panel.c.diff'`; then
- echo shar: \"'panel.c.diff'\" unpacked with wrong size!
- fi
- # end of 'panel.c.diff'
- fi
- echo shar: End of archive 5 \(of 7\).
- cp /dev/null ark5isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 7 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- dan
- -----------------------------------------------------------
- O'Reilly && Associates
- argv@sun.com / argv@ora.com
- 632 Petaluma Ave, Sebastopol, CA 95472
- 800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104
- Opinions expressed reflect those of the author only.
-